package com.starfactory.gateway;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "com.starfactory.common.feign")
@ComponentScan(basePackages = {"com.starfactory", "com.starfactory"})
@EnableAsync
public class GatewayApplication {

    private static final Logger logger = LoggerFactory.getLogger(GatewayApplication.class);

    public static void main(String[] args) {
        logger.info("GatewayApplication begin");
        SpringApplication application = new SpringApplication(GatewayApplication.class);
        application.setAllowBeanDefinitionOverriding(true);
        ConfigurableApplicationContext run = application.run(args);
        logger.info("GatewayApplication success");
    }

}
